$(function(){
    $('#datetimepicker1').datetimepicker({  
        format: 'YYYY-MM-DD',  
        locale: moment.locale('zh-cn')  
    }); 
});

function save() {
	$.ajax({
		url : $WEB_ROOT_PATH + "/person/add.do",
		type : "post",
		dataType : "json",
		data : $('#personForm').serialize(),
		error : function(e) {

		},
		success : function(result) {
			alert(result.msg);
			if (result.status == 0) {
				window.location.href = $WEB_ROOT_PATH + "/person/query.do";
			}
		}
	});
}

function update() {
	$.ajax({
		url : $WEB_ROOT_PATH + "/person/update.do",
		type : "post",
		dataType : "json",
		data : $('#personForm').serialize(),
		error : function(e) {

		},
		success : function(result) {
			alert(result.msg);
			if (result.status == 0) {
				window.location.href = $WEB_ROOT_PATH + "/person/query.do";
			}
		}
	});
}

function go_back() {
	window.history.go(-1);
}